package com.cherkashyn.vitaliy.devices.ethernet.socket3.commands.info;

import java.net.Socket;

import com.cherkashyn.vitaliy.devices.ethernet.socket3.commands.BaseCommand;
import com.cherkashyn.vitaliy.devices.ethernet.socket3.exceptions.ModuleExchangeException;

abstract class CommandInformationMain extends BaseCommand<Byte>{
	private final static byte[] request=new byte[]{0x44};
	
	@Override
	protected int getLengthOfResponse() {
	    return 5;
	} 

	@Override
	protected byte[] getRequestBytes() {
	    return request;
	}
	
	@Override
	public Byte execute(Socket socket) throws ModuleExchangeException {
	    return this.doRequest(socket)[getInformationByte()];
	}

	protected abstract int getInformationByte();

}
